package flexo.math;

public class Rect
{
	public Coords topLeft;
	public Coords bottomRight;
	
	public Rect()
	{
		topLeft = new Coords();
		bottomRight = new Coords();
	}
	
	public Rect(float left, float top, float right, float bottom)
	{
		topLeft = new Coords(left,top);
		bottomRight = new Coords(right,bottom);
	}
	
	/**
	 * @return true if the x,y position is inside the rectangle
	 */
	public boolean isInside(float x, float y)
	{
		if (x >= topLeft.x && x <= bottomRight.x && y >= bottomRight.y && y <= topLeft.y)
			return true;
		return false;
	}
}
